package com.example.resubmit.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * redisson 配置类
 * Created on 2018/6/19
 */
@Configuration
public class RedissonConfig {

    @Value("${spring.redis.host}")
    private String host;

    @Value("${spring.redis.port}")
    private String port;

    @Value("${spring.redis.password}")
    private String password;


    public  String getAddr(){
        return "redis://" + host + ":" + port;
    }

    public String getPassword(){
        return  password;
    }
   /* @Bean
    public RedissonClient getRedisson(){
        Config config = new Config();
        SingleServerConfig serverConfig =  config.useSingleServer();
        serverConfig.setAddress("redis://" + host + ":" + port);
        if(!StringUtils.isEmpty(password)){
            serverConfig.setPassword(password);
        }
        return Redisson.create(config);
    }*/

}